home *** CD-ROM | disk | FTP | other *** search
/ IRIX Development Foundation 1.1 for IRIX 6.2 / SGI IRIX 6.2 Development Foundation 1.1.iso / dist / patchSG0001645.idb / usr / include / rtlock.h.z / rtlock.h
C/C++ Source or Header  |  1997-07-01  |  2KB  |  52 lines

  1. /**************************************************************************
  2.  *                                                                        *
  3.  *               Copyright (C) 1996 Silicon Graphics, Inc.                *
  4.  *                                                                        *
  5.  *  These coded instructions, statements, and computer programs  contain  *
  6.  *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
  7.  *  are protected by Federal copyright law.  They  may  not be disclosed  *
  8.  *  to  third  parties  or copied or duplicated in any form, in whole or  *
  9.  *  in part, without the prior written consent of Silicon Graphics, Inc.  *
  10.  *                                                                        *
  11.  **************************************************************************/
  12.  
  13. #ifndef __RTLOCK_H__
  14. #define __RTLOCK_H__
  15.  
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19.  
  20. #include "sgidefs.h"
  21.  
  22. typedef struct rtlock_s {
  23.     union {
  24.         unsigned long long rt_data;
  25.         struct {
  26.             unsigned short    owner;
  27.             unsigned short    waiters;
  28.             unsigned int    reserved;
  29.         } rt_datafield;
  30.     } rt_state;
  31.     unsigned int rt_spins;  
  32. } rtlock_t;
  33.  
  34. #define rt__Owner    rt_state.rt_datafield.owner
  35. #define rt__Waiters    rt_state.rt_datafield.waiters
  36.  
  37. #define RTLOCK_DEFAULT_SPINS 600
  38.  
  39. #if    _SGIAPI
  40. extern int rtlock_init(rtlock_t *, unsigned int);
  41. extern int rtlock_acquire(rtlock_t *);
  42. extern int rtlock_release(rtlock_t *);
  43. extern int __rtlock_init(rtlock_t *, unsigned int);
  44. extern int __rtlock_acquire(rtlock_t *);
  45. extern int __rtlock_release(rtlock_t *);
  46. #endif    /* _SGIAPI */
  47.  
  48. #ifdef __cplusplus
  49. }
  50. #endif
  51. #endif /* __RTLOCK_H__ */
  52.